package shuati.meituan;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author : LdLtd
 * @Date : 2024/4/6
 * @Description:
 * b和c是a数字删去一个数字后的前缀和乱序
 * 还原a数组
 * 方法，排序，a数组大于0，所以前缀和递增
 * 还原删去两个数字的a数组，找出删去的位置，填充
 */
public class c040603 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long  [] br=new long [n-1];
        long  [] cr=new long [n-1];
        //1 8 6 4
        // 1    4
        // 8 6 4   1 8 6
        // 8 14 18  1 9 15
        for (int i = 0; i < n-1; i++) {
            br[i]=sc.nextLong();
        }
        for (int i = 0; i < n-1; i++) {
            cr[i]=sc.nextLong();
        }
        Arrays.sort(cr);
        Arrays.sort(br);
        long []bb=new long[n-1];
        long [] cc=new long[n-1];
        bb[0]=br[0];
        cc[0]=cr[0];
        for (int i = 1; i < n-1; i++) {
            bb[i]=br[i]-br[i-1];
            cc[i]=cr[i]-cr[i-1];
        }
        long [] ar=new long[n];
        int i=0;
        for (; i < n-1; i++) {
            if(bb[i]!=cc[i]){
                if(i<n-2){
                    if(bb[i]==cc[i+1]){
                        ar[i]=cc[i];
                        for (int j = i; j < n-1; j++) {
                            ar[j+1]=bb[j];
                        }
                        break;
                    }else if(cc[i]==bb[i+1]){
                        ar[i]=bb[i];
                        for (int j = i; j < n-1; j++) {
                            ar[j+1]=bb[j];
                        }
                        break;
                    }
                }
            }else{
                ar[i]=bb[i];
            }
        }
        for (long i1 : ar) {
            System.out.print(i1+" ");
        }
    }

}
